package com.xiaoma.mframe.project.tool.gen.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.xiaoma.mframe.general.utils.AjaxResult;
import com.xiaoma.mframe.general.web.controller.BaseController;
import com.xiaoma.mframe.project.tool.gen.entity.User;
import com.xiaoma.mframe.project.tool.gen.service.IUserService;


/**
 * 自动生成代码入口
 *
 *
 *  @version 1.0,2017-9-24 10:02:08
 */
@Controller
@RequestMapping("/system/login")
public class IndexController  extends BaseController {
		private String prefix = "system/login";

		@Autowired
		private IUserService userService;

		@GetMapping()
		public String user() {
			return prefix + "/login";
		}

    @RequestMapping("/index")
    public String login1(){
        return "/system/login/login";
    }


  /*  @RequestMapping("/login")                         
    public String login(@RequestBody  User user, HttpServletRequest request){
    	//return String.valueOf(userService.login(user,request));
		 
    	
    	if(userService.login(user,request)==1){
    		return "system/template/template";
    	}
    	return "system/login/login";
 
    }*/
    
    @RequestMapping("/login")                         
    public void login(@RequestBody  User user, HttpServletRequest request){
    	userService.login(user,request);
	
    }
    

}